<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="/common/_container :: htmlhead"></head>
<head>
    <title>增加文章</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <script th:src="@{/static/ueditor/ueditor.config.js}"></script>
    <script th:src="@{/static/ueditor/ueditor.all.min.js}"></script>
    <script th:src="@{/static/modular/article/article.js}"></script>
    <style type="text/css">
        div{
            width:100%;
        }
    </style>
</head>
<body>
<div>

<input type="hidden" id="articleTypeValue" th:value="${article.type}" />
<input type="hidden" id="articleIsTopValue" th:value="${article.isTop}" />
<input type="hidden" id="articleTextSourceValue" th:value="${article.textSource}" />
<input type="hidden" id="articleContentValue" th:value="${article.content}" />

	<br></br>
	&nbsp;<font size="4">文章标题：</font><input type="text" size="50"  id="title"  th:value="${article.title}" placeholder="填写标题" /><br></br>
	&nbsp;<font size="4">num：</font><input type="text" size="50"  id="num" th:value="${article.num}" placeholder="num" /><br></br>
	&nbsp;<font size="4">文章类型：</font><select id="type" name="type">
							<option value="0">通知</option>
							<option value="1">新闻</option>
							<option value="2">banner新闻</option>
							<option value="3">栏目</option>
						</select><br></br>
	&nbsp;<font size="4">是否置顶：</font><select id="isTop" name="clzz">
							<option value="0">否</option>
							<option value="1">是</option>
						</select><br></br>
	&nbsp;<font size="4">来源：</font><input type="text" size="50"  id="textSource"   placeholder="填写来源" /><br></br>
	&nbsp;<font size="4">展示图片：</font><img width="100px" height="100px" id="avatarPreId"  src="" onclick="selectFile()"/> 
 							<i class="fa fa-upload" onclick="selectFile()"></i>&nbsp;
							<input type="file" id="fileUploadBtn" style="display:none" accept="gif,jpg,jpeg,bmp,png" onchange="uploadFile()"/>
							<input type="hidden" id="topUrl" />  
	<br></br><br></br>
    <script id="editor" type="text/plain" style="width:100%;height:500px;"></script>
</div>
<!-- 
<div id="btns">
    <div>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     	<button type="button" onclick="getContent()" >
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提交&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 	</button>
    </div>
    <div>
    </div>

    <div>
        
    </div>

</div>
 -->
  <div>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     	<button type="button" onclick="closeDlg()" >
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 	</button>
    </div>

<div>
</div>
<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor');


    function isFocus(e){
        alert(UE.getEditor('editor').isFocus());
        UE.dom.domUtils.preventDefault(e)
    }
    function setblur(e){
        UE.getEditor('editor').blur();
        UE.dom.domUtils.preventDefault(e)
    }
    function insertHtml() {
        var value = prompt('插入html代码', '');
        UE.getEditor('editor').execCommand('insertHtml', value)
    }
    function createEditor() {
        enableBtn();
        UE.getEditor('editor');
    }
    
    $(function(){
		$("input").attr("disabled",true);
		$("select").attr("disabled",true);
	});
</script>
</body>
</html>

